package StudyCode.summary.mycollection;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ConvertAnyArrayToList {
	public static void main(String[] argv) {
		String[] array = new String[]{"www.tah1986.com"};
		System.out.println(arrayToList(array));
	}

	public static List<Object> arrayToList(Object array) {
		List<Object> result = new ArrayList<>();
		int length = Array.getLength(array);
		for (int i = 0; i < length; i++) {
			result.add(Array.get(array, i));
		}
		return result;
	}

}
